package com.server.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;


/**
 * The persistent class for the City database table.
 * 
 */
@Entity
@XmlRootElement
@Table(schema="mhp")
public class City implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private long cityId;

	private String cityName;
	
	
	@ManyToOne(cascade={CascadeType.PERSIST,CascadeType.MERGE})
	@JoinColumn(name="areaId",insertable=false, updatable=false)
	private Area area;

	
	@OneToMany(mappedBy="city",cascade={CascadeType.PERSIST,CascadeType.MERGE})
	private List<Item> items;
	
	public City() {
	}

	public long getCityId() {
		return this.cityId;
	}

	public void setCityId(long cityId) {
		this.cityId = cityId;
	}

	public String getCityName() {
		return this.cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

}